20 步:这是一个漫长的学年,你不记得你的最高成绩是多少。让我们找到它!

要获取列表中的最后一项,您可以使用特殊索引-1 。该索引始终返回最后一项。

  • 并将Sort List拖到main()的底部。 my_list更改为grades
  • 拖入Get Value at Index 。将 my_var 更改为my_varmy_list更改grades highest_grade
  • 将方括号中的索引从0更改为-1

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)